//WD统计
function isPC() {
    var userAgentInfo = navigator.userAgent;
    var Agents = ["Android", "iPhone",
        "SymbianOS", "Windows Phone",
        "iPad", "iPod"];
    var flag = true;
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            flag = false;
            break;
        }
    }
    return flag;
}
function isTouchDevice(){
    try {
        document.createEvent("TouchEvent");
        return true;
    }
    catch (e) {
        return false;
    }
}

$(document).on('click', '.tongji', function(){
    var data = $(this).data();
    pushGsqData(data['action']);
    //console.log("统计！" + data['action']);
});

function pushGsqData(data){
    var platform = isTouchDevice()?'mobile':'pc';
    _gsq.push(["T","GWD-002889","trackEvent","xycdn2016",data,platform]);
}

$(document).on('click', '.bdtongji', function(){
    var data = $(this).data();
    var platform = window.location.pathname.indexOf("/m/") == 0?'m':'pc';
    if(typeof(_hmt)!="undefined"){
        _hmt.push(['_trackEvent',platform,data['category'],platform + "/" + data['category'] + "/" + "点击[" + data['bdaction'] + "]"]);
        //console.log("百度统计！" + platform + "/" + data['category'] + "/" + "点击[" + data['bdaction'] + "]");
    }
});